<template>
  <view class="balance_container flex-c">
    <image :src="require('../../static/index/balance.png')" alt="" class="coin_pic" />
    <view class="text">余额</view>
    <view class="balance_count">￥{{mch_info.balance}}</view>
    <!-- <view class="text2">免费开通零钱通 给自己加加薪</view> -->
    <view class="divide"></view>
    <view class="btn_container flex-c">
      <van-button color="#FE3772" custom-class=" btn" @tap="go_next('recharge')" v-if="had_weixin">充值</van-button>
      <van-button color="#FE3772" custom-class="with_btn btn" @tap="go_next('with')">提现</van-button>
    </view>
  </view>
</template>

<script>
let app =  getApp();
export default {
  props: {},
  components: {},
  data() {
    return {
        mch_info:{},
        had_weixin:true
    };
  },
  computed: {},
  watch: {},
  onLoad() {
      this.mch_info=app.globalData.userinfo
      //#ifdef APP-PLUS
       if (
      plus.runtime.isApplicationExist({
        pname: "com.tencent.mm",
        action: "weixin://",
      })
    ) {
      console.log("微信应用已安装");
      this.had_weixin=true
    } else {
      console.log("微信应用未安装");
      this.had_weixin=false
    }
    //#endif
  },
  onReady() {},
  onShow() {},
  methods: {
      go_next(type) {
          if(type=='recharge') {
              uni.navigateTo({
                   url: '/pages/recharge_page/recharge_page'
              });
          }else {
               uni.navigateTo({
                   url: '/pages/withdraw/withdraw'
              });
          }
      }
  },
  onReachBottom() {},
  onHide() {},
};
</script>

<style scoped lang="scss" >
.balance_container {
  padding: 0 30rpx;
}
.coin_pic {
  width: 130rpx;
  height: 130rpx;
  margin: 12rpx 0 50rpx;
}
.text {
  font-size: 26rpx;
  font-family: PingFangSC-Regular, PingFang SC;
  font-weight: 400;
  color: #9d9ca3;
}
.balance_count {
  font-size: 60rpx;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: #fa6400;
  margin: 50rpx 0 22rpx;
}
.divide {
    width: 100%;
  height: 4rpx;
  background-color: #fafafe;
  margin: 44rpx 0 188rpx;
}
.btn_container {
}
/deep/ .btn {
  width: 342rpx;
  height: 80rpx;
  background: #fe3772;
  border-radius: 50rpx;
  font-size: 48rpx;
  font-family: PingFangSC-Semibold, PingFang SC;
  font-weight: 600;
  color: #ffffff;
  line-height: 80rpx;
}
/deep/ .with_btn {
  opacity: 0.23;
  margin-top: 34rpx;
}
</style>
